package com.sinosoft.weixin.shiro;

import com.sinosoft.weixin.utils.MessageDigestUtils;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.authc.credential.SimpleCredentialsMatcher;

/**
 * Created by huzhengying on 2017/11/11.
 */
public class CredentialsMatcher extends SimpleCredentialsMatcher {

    @Override
    public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
//        UsernamePasswordToken utoken=(UsernamePasswordToken) token;
//        //获得用户输入的密码
//        String inPassword = new String(utoken.getPassword());
//        System.out.println("inPassword--"+inPassword);
//        //获得数据库中的密码
//        String dbPassword=(String) info.getCredentials();
//        System.out.println("dbpassword--"+dbPassword);
//        //进行密码的比对
        return true;
    }
}
